from color_setup import SSD  # Create a display instance
from gui.core.colors import RED, BLUE, GREEN
from gui.core.nanogui import refresh
refresh(SSD, True)  # Initialise and clear display.
# Uncomment for ePaper displays
# ssd.wait_until_ready()
SSD.fill(0)
SSD.line(0, 0, SSD.width - 1, SSD.height - 1, GREEN)  # Green diagonal corner-to-corner
SSD.rect(0, 0, 15, 15, RED)  # Red square at top left
SSD.rect(SSD.width -15, SSD.height -15, 15, 15, BLUE)  # Blue square at bottom right
refresh(SSD)

from lib.gui.core.nanogui import refresh
from lib.gui.widgets.label import Label  # Import any widgets you plan to use
from lib.gui.widgets.dial import Dial, Pointer

from lib.gui.core.writer import CWriter  # Renders color text
from lib.gui.fonts import arial10  # A Python Font
from lib.gui.core.colors import *  # Standard color constants

refresh(SSD, True)  # Initialise and clear display.

CWriter.set_textpos(SSD, 5, 5)  # In case previous tests have altered it
 # Instantiate any CWriters to be used (one for each font)
wri = CWriter(SSD, arial10, GREEN, BLACK, verbose=False)  # Colors are defaults
# wri = Writer(ssd, arial10, verbose=False)  # Monochrome display uses Writer
wri.set_clip(True, True, False)

# End of boilerplate code. This is our application:
Label(wri, 6, 2, 'Hello world!1')
refresh(SSD)